In this brief set of exercises, you will try some simple solutions for dependency management in R. For this, you should continue working with the R script you have created and pushed to your GitHub repository in the previous sessions.

Exercise 1

First, add some basic reproducibility information about the version of R and the packages you use to your script. If you want to, you can can exclude information about your locale.
You can use a simple function from base R to get some information about your current session. If you want to exclude information about your locale, you need to wrap that function into a call to the print() function and provide it with an additional argument.

Exercise 2

Now, use the groundhog package to add load the packages you use in your script.
Do not forget to specify a date. You can just use today’s date.

If you are done with these exercises very quickly or if they are too easy for you, feel free to change the arguments for the groundhog.library() function and see what happens. You can also try to use the groundhog package to install a package that is not available on CRAN anymore. Or read some of the detailed documentation on the groundhog package website.